package com.tangula.web.kashine.repository;

import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import com.tangula.web.kashine.entity.StudentAccountForm;

@Repository
public interface StudentAccountFormRepository  extends JpaRepository<StudentAccountForm, String>{
	@Query(nativeQuery=true,value="SELECT a.id AS student_id,a.`name` AS student_name,a.image AS student_icon,a.account_desc AS student_desc FROM t_account a WHERE a.id NOT IN(SELECT so.student_id FROM t_studentorganizationref so) LIMIT :index , :size")
	List<StudentAccountForm> loadAllFreeStudents(@Param("index")int index, @Param("size")int size);

}
